<style>
	.form-control{color:red;font-weight:bold;}
</style>
<script type="text/javascript">
	$(function(){
		$("#upfm").submit(function(){
			var file1 = document.getElementById("file0");
			var size = file1.files[0];
			if(size===undefined){
				new $.zui.Messager('请选择文件！', {
					icon: 'cloud-upload',// 定义消息图标
					type: 'warning',
					time:'1000'
				}).show();
				return false;
			}
			size = file1.files[0].size;
			if (size>104857600){
				new $.zui.Messager('您上传的文件大于100MB，请重新选择上传文件！', {
					icon: 'cloud-upload',// 定义消息图标
					type: 'warning',
					time:'1000'
				}).show();
				return false;
			}
		})
	});
</script>

<table class="table">
  <tbody>
  <#list list as shareFile>
    <tr>
      <td width="300">${shareFile.fileName!}</td>
      <td width="200">
		  <#if shareFile.fileSize lt 1024>
			  ${shareFile.fileSize!}B
		  <#elseif shareFile.fileSize lt 1024*1024>
			  ${(shareFile.fileSize/1024)?string('0.0')!}KB
		  <#elseif shareFile.fileSize lt 1024*1024*1024>
			  ${(shareFile.fileSize/1024/1024)?string('0.0')!}MB
		  </#if>
	  </td>
      <td width="200">${(shareFile.uploadTime)?string('yyyy-MM-dd')!}</td>
      <td width="200">${shareFile.uploadName!}</td>
      <td>
		<a href="javascript:void(0)" style="margin-right:50px;"
			data-toggle="modal" data-target="#deleteFile${shareFile.id!}">删除</a>
			<!-- 对话框HTML 上传文件至共享空间	-->
			<div class="modal fade" id="deleteFile${shareFile.id!}">
			  <div class="modal-dialog" style="width: 420px;height: 250px;">
			    <div class="modal-content" style="margin: 10px;">
			      <div class="addUser" >
			      	<h2><i>删除共享空间中的文件</i></h2>
			      	<hr/>
			      	<h4><i>是否删除该文件</i></h4>
			      	<div class="file-oper">
		      			<table class="table table-bordered">
							<thead>
								<tr>
									<th>文件名</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>${shareFile.fileName!}</td>
								</tr>
							</tbody>
						</table>
						<div class="delete-btn">
							<a class="btn btn-primary" href="shareFile!deleteFile?id=${shareFile.id!}&fileName=${shareFile.fileName!}">删除</a>
							<a class="btn btn-primary" href="shareFile!showAllShareFile">取消</a>
						</div>
			      	</div>
			      	</div>
			      </div>
			    </div>
			  </div>
    	<!-- 对话框HTML 上传文件至共享空间	结束-->
	  </td>
    </tr>
 	 </#list>
  </tbody>
</table>
<!-- 对话框HTML 上传文件至共享空间	-->
<div class="modal fade" id="uploadFile">
  <div class="modal-dialog" style="width: 410px; height: 250px;">
    <div class="modal-content" style="margin: 10px;">
      <div class="addUser" >
      	<h2><i>上传文件至共享空间</i></h2>
      	<hr/>
      	<h4><i>上传文件(请上传小于100MB的文件)</i></h4>
      	<form action="shareFile!fileUpload" method="post" id="upfm" enctype="multipart/form-data">
      		
      	  	<div class="form-group" >
			    <input type="file" class="form-control" id="file0" name="file"
			    	placeholder="文件名">
			</div>
		 	<div class="add-btn">
		  		<input type="submit" value="上传" class="btn"/>
				<a class="btn" href="shareFile!showAllShareFile">取消</a>
		  	</div>
		 </form>
      	</div>
      </div>
    </div>
  </div>
    	<!-- 对话框HTML 上传文件至共享空间	结束-->
